<?php
/**
 * User: @sunyu
 * Date: 2019-12-10
 * Time: 11:47
 */

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/search',
    'namespace' => 'Frieza\\Modules\\Search\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    $router->get('/index/{step}', 'SearchController@index');
    $router->get('/index/{step}/create', 'SearchController@edit');
    $router->get('/index/{step}/{id}/edit', 'SearchController@edit');
    $router->delete('/index/{step}/{id}', 'SearchController@del');
    $router->post('/index/save', 'SearchController@editSubmit');
    $router->post('/index/saveSearch', 'SearchController@save');

    $router->get('/adv/{type}', 'SearchAdvController@index');
    $router->get('/adv/{type}/create', 'SearchAdvController@edit');
    $router->get('/adv/{type}/{id}/edit', 'SearchAdvController@edit');
    $router->post('/adv/save', 'SearchAdvController@save');
    $router->delete('/adv/{type}/{id}', 'SearchAdvController@del');

    $router->get('/preset/recommend/{type}', 'PresetKeywordController@index');
    $router->get('/preset/recommend/{type}/create', 'PresetKeywordController@edit');
    $router->post('/preset/recommend/save', 'PresetKeywordController@save');
    $router->delete('/preset/recommend/{type}/{id}', 'PresetKeywordController@del');

    $router->get('/select/index', 'SelectConfigController@index');
    $router->post('/select/sort', 'SelectConfigController@sortType');
    $router->get('/select/{type}/option', 'SelectConfigController@option');
    $router->delete('/select/{type}/option/{id}', 'SelectConfigController@del');
    $router->post('/select/{type}/option/{id}/relation', 'SelectConfigController@relation');
    $router->post('/select/{type}/sort', 'SelectConfigController@sortKey');
    $router->get('/select/create', 'SelectConfigController@create');
    $router->post('/select/save', 'SelectConfigController@save');

    $router->get('/keyword/index', 'SearchAllTagController@index');
    $router->get('/keyword/index/create', 'SearchAllTagController@create');
    $router->get('/keyword/index/{id}/edit', 'SearchAllTagController@create');
    $router->post('/keyword/save', 'SearchAllTagController@save');
    $router->post('/keyword/sort', 'SearchAllTagController@sort');
    $router->delete('/keyword/index/{id}', 'SearchAllTagController@del');

    $router->get('/searchIntervention/index', 'SearchInterventionController@index');
    $router->get('/searchIntervention/index/create', 'SearchInterventionController@createKeyword');
    $router->post('/searchIntervention/saveKeyword','SearchInterventionController@saveKeyword');
    $router->get('/searchIntervention/{related_id}/check','SearchInterventionController@check');
    $router->get('/searchIntervention/{related_id}/check/newest','SearchInterventionController@checkNewest');
    $router->get('/searchIntervention/{related_id}/check/create','SearchInterventionController@createSearchIntervention');
    $router->get('/searchIntervention/{related_id}/check/newest/create','SearchInterventionController@createSearchIntervention');
    $router->post('/searchIntervention/{related_id}/saveSearchInv','SearchInterventionController@saveSearchIntervention');
    $router->get('/searchIntervention/{related_id}/check/{id}/edit','SearchInterventionController@updateSearchIntervention');
    $router->get('/searchIntervention/{related_id}/check/newest/{id}/edit','SearchInterventionController@updateSearchIntervention');
    $router->post('/searchIntervention/{related_id}/check/{id}/editUpload','SearchInterventionController@editSearchIntervention');
    $router->get('/searchIntervention/{id}/delete','SearchInterventionController@deleteSearchIntervention');
    $router->get('/searchIntervention/downExcel','SearchInterventionController@downExcel');
    $router->get('/searchIntervention/importExcel','SearchInterventionController@importExcel');
    $router->post('/searchIntervention/saveExcel','SearchInterventionController@saveExcel');

    $router->get('/searchFeedback/index', 'SearchFeedbackController@index');
});
